package com.bds.snatch.system.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by guoyu on 2017/8/9.
 */
public class RexUtils {

    //获取网页编码
    public static String matchCharset(String content) {
        String chs = "utf-8";
        Pattern p = Pattern.compile("(?<=charset=)(.+)(?=\")");
        Matcher m = p.matcher(content);
        if (m.find())
            return m.group();
        return chs;
    }
}
